package com.xzjt.web.entity;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;

import java.io.Serializable;
import java.util.List;

/**
 * @ClassName: SysUser
 * @Author: yuandong
 * @Date 2021/10/8 13:25
 */
@Data
@TableName("sys_user")
public class SysUser implements Serializable {

    @TableId(type = IdType.AUTO)
    private Integer id;

    private String username;

    private String password;

    private String nickName;

    private String salt;

    private Integer age;

    private String sex;

    private String address;

    private String url; //头像路径

    private Integer isAdmin; //是否是超管  1:超管  2：其它

    @TableLogic     //mybatisplus注解，加了该注解，使用mp进行删除的时候进行的是逻辑删除
    private Integer del_flag;  //1:正常  0：已删除

    @TableField(exist = false)
    private Integer roleId;  //用户角色

    @TableField(exist = false)
    private String roleName;  //用户角色名称

    //辅助字段
    @TableField(exist = false)
    private String captchacode;   //用户登录时的验证码

    @TableField(exist = false)
    private String key;    //验证码在缓存中对应的key


    @TableField(exist = false)
    private List<SysRole> roles;




}
